# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gimp
pkgver=2.10.32
pkgrel=0
pkgdesc="GNU Image Manipulation Program"
url="https://www.gimp.org/"
arch="all !s390x !riscv64" # limited by librsvg -> rust
license="GPL-3.0-or-later"
makedepends="gtk+2.0-dev libxpm-dev libxmu-dev librsvg-dev dbus-glib-dev
	libexif-dev desktop-file-utils intltool gegl-dev tiff-dev
	libjpeg-turbo-dev libpng-dev iso-codes-dev lcms2-dev poppler-dev
	babl-dev gexiv2-dev glib-networking xz-dev mypaint-brushes libmypaint-dev
	poppler-data libexecinfo-dev libjxl-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
source="https://download.gimp.org/pub/gimp/v${pkgver%.*}/gimp-$pkgver.tar.bz2"
options="!check"

# secfixes:
#   2.8.22-r2:
#     - CVE-2017-17784
#     - CVE-2017-17785
#     - CVE-2017-17786
#     - CVE-2017-17787
#     - CVE-2017-17788
#     - CVE-2017-17789

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--disable-dependency-tracking \
		--sysconfdir=/etc \
		--enable-mp \
		--enable-gimp-console \
		--disable-python \
		--without-aa \
		--disable-check-update
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

dev() {
	default_dev
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/gimptool* "$subpkgdir"/usr/bin
}

sha512sums="
aa999c1ec388154965f84d995a9b5517e9c38608d03a0d0bb6ec9fa55de946f9da106e7d6f7c02052b61d2b6806e7a378e786539f0de5b5ffaa2fcd1bbd9c7f1  gimp-2.10.32.tar.bz2
"
